Merge "phpunit: Use assertEquals(, $delta) in UserTest instead of greater/lessThan"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 6 Jan 2017 23:15:43 +0000 (23:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 6 Jan 2017 23:15:43 +0000 (23:15 +0000)
tests/phpunit/includes/user/UserTest.php

index 47fd56d..94c6b4f 100644 (file)
@@ -726,13 +726,11 @@ class UserTest extends MediaWikiTestCase {
                $this->assertArrayHasKey( 'wm_infinite_blockBlockID', $cookies );
                $expOneDay = wfTimestamp() + ( 24 * 60 * 60 );
                // Check for expiry dates in a 10-second window, to account for slow testing.
-               $this->assertGreaterThan(
-                       $expOneDay - 5,
-                       $cookies['wm_infinite_blockBlockID']['expire']
-               );
-               $this->assertLessThan(
-                       $expOneDay + 5,
-                       $cookies['wm_infinite_blockBlockID']['expire']
+               $this->assertEquals(
+                       $expOneDay,
+                       $cookies['wm_infinite_blockBlockID']['expire'],
+                       'Expiry date',
+                       5.0
                );
 
                // 3. Change the block's expiry (to 2 hours), and the cookie's should be changed also.